package com.max.base;

import java.util.List;

public class BaseServiceImpl<D extends BaseDao<E>, E> implements BaseService<E> {

    protected final D dao;

    public BaseServiceImpl(D dao) {
        this.dao = dao;
    }

    @Override
    public int insert(E entity) {
        return dao.insert(entity);
    }

    @Override
    public int updateById(E entity) {
        return dao.updateById(entity);
    }

    @Override
    public int deleteById(Long id) {
        return dao.deleteById(id);
    }

    @Override
    public E queryById(Long id) {
        return dao.queryById(id);
    }

    @Override
    public List<E> selectList(E entity) {
        return dao.selectList(entity);
    }
}
